with open("walden.txt", "r") as f:
    words1 = f.read()
    words2 = words1.split()
    dict1 = {}
    for i in words2:
        if i.isalpha():
            dict1[i] = dict1.get(i, 0) + 1
        # else:
        #     dict1.pop(i)
    print(dict1)

